dnl This should be a way to detect v8 given that it does not
dnl provide a pkg-config file

AC_DEFUN([V8],
[
   AC_LANG_PUSH(C++)
   AC_SUBST(V8_LIBS)
   AC_MSG_CHECKING([for libv8])
   saved_LIBS="$LIBS"
   LIBS="$LIBS -lv8"
   AC_LINK_IFELSE(
    [AC_LANG_PROGRAM(
     [[
      #include <v8.h>
      v8::Persistent<v8::Number> n;
     ]],
     [[
      n = v8::Persistent<v8::Number>::New(v8::Number::New(0));
      v8::Handle<v8::Object> o = v8::Object::New();
     ]],
   )],[[V8_LIBS="-lv8"], [have_v8="yes"]], [have_v8="no"])
   LIBS="$saved_LIBS"
   AC_MSG_RESULT([${have_v8}])
   AC_LANG_POP
])
